package com.jthinker.dao.impl;

import com.jthinker.dao.BaseDao;
import com.jthinker.dao.MenuDao;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * User: Gang Chen
 * Date: 2015/3/15 21:25
 */
@Repository
public class MenuDaoImpl implements MenuDao
{
    @Resource
    private BaseDao baseDao;

    @Override
    public void create(Map<String, Object> record) throws Exception
    {
        baseDao.insert("sys_menu", record);
    }

    @Override
    public List<Map<String, Object>> findAll()
    {
        return baseDao.query("SELECT * FROM sys_menu");
    }

    @Override
    public void delete(Serializable id) throws Exception
    {
        baseDao.delete("sys_menu", "id=?", id);
    }

}
